package cn.coisini.api.admin;

import cn.coisini.model.common.dtos.Result;
import cn.coisini.model.common.enums.ResultEnum;
import cn.coisini.model.pojo.AsyncOperLog;
import cn.coisini.model.vo.AsyncOperLogQueryVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author xiangshaw
 * Description: 操作日志接口API
 */
@Tag(name = "操作日志接口API", description = "记录操作日志")
@RequestMapping("/api/v1/operLog")
public interface AsyncOperLogControllerApi {

    @Operation(summary = "条件分页查询操作日志")
    @PreAuthorize("hasAuthority('operLog.list')")
    @GetMapping("/list")
    Result<Page<AsyncOperLog>> pagingQuery(AsyncOperLogQueryVo asyncOperLogQueryVo);

    @Operation(summary = "根据id查询操作日志")
    @GetMapping("/get/{id}")
    Result<AsyncOperLog> getOpenLog(@PathVariable("id") String id);

    @Operation(summary = "根据id删除操作日志")
    @PreAuthorize("hasAuthority('operLog.remove')")
    @DeleteMapping("/remove/{id}")
    Result<ResultEnum> removeOperLogById(@PathVariable("id") String id);

    @Operation(summary = "批量删除操作日志")
    @PreAuthorize("hasAuthority('operLog.batchRemove')")
    @DeleteMapping("/batchRemove")
    Result<ResultEnum> batchRemove(@RequestBody List<String> ids);
}
